import {
	mapMutations
} from 'vuex';
export default {
	methods: {
		...mapMutations(['$uStore']),
		addDevice() {
			this.$postAction(this.$deviceapi.addDevice, {
				bindState: 1,
				deviceTypeId: this.deviceTypeId,
				userId: this.userInfo.userId,
				devName: this.connectedDevice.name,
				mac: this.connectedDevice.deviceId
			}).then(da => {
				this.getDeviceList()
			});
		},
		getDeviceList() {
			return this.$postAction(this.$deviceapi.getDeviceList, {
				userId: this.userInfo.userId
			}).then(da => {
				/* 保存设备信息 */
				this.$uStore({
					name: 'devicelist',
					value: da
				});
			});
		},
	}
};